<template>
  <div v-if="getShow">
    <LoginFormTitle class="enter-x" title="重置密码" />
    <a-form class="p-4 enter-x" :model="formData" :rules="getFormRules" ref="formRef">
      <a-form-item name="account" class="enter-x">
        <a-input
          size="large"
          v-model:value="formData.account"
          placeholder="账号"
        />
      </a-form-item>

      <a-form-item name="mobile" class="enter-x">
        <a-input size="large" v-model:value="formData.mobile" placeholder="手机号码" />
      </a-form-item>
      <a-form-item name="sms" class="enter-x">
        <CountdownInput
          size="large"
          v-model:value="formData.sms"
          placeholder="短信验证码"
        />
      </a-form-item>

      <a-form-item class="enter-x">
        <a-button type="primary" size="large" block @click="handleReset" :loading="loading">
          重置
        </a-button>
        <a-button size="large" block class="mt-4" @click="handleBackLogin">
          返回
        </a-button>
      </a-form-item>
    </a-form>
  </div>
</template>

<script>
import LoginFormTitle from './LoginFormTitle.vue';
import CountdownInput from '@/components/CountDown/CountdownInput';

export default {
  name: 'ForgetPasswordForm',
  components: {
    LoginFormTitle,
    CountdownInput
  },
  props: {
    visible: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    getShow: {
      get: function() {
        return this.visible;
      },
      set: function(val) {
        this.$emit('update:visible', val);
      }
    }
  },
  data() {
    return {
      formData: {},
      getFormRules: {},
      loading: false
    };
  },
  methods: {
    handleReset() {},
    handleBackLogin() {
      this.$emit('backLogin')
    }
  }
}
</script>
